Module logger
[hide private]

Module logger

source code

This library contains log utilities and helper functions for error reporting. It contains APIs to log the at debug, info, and error levels.

The logs configuration is in the probeMgrLog4j.properties file. By default, the messages from the log level and up are written to probeMgr-patternsDebug.log in the discovery probe log folder. The info and error messages are also displayed on the console.

There are two sets of APIs:

The first set issues the concatenation of all its string arguments in the appropriate log level. The second does the same along with the most recent thrown exception's stack trace. This facilitates understanding the cause of the exception.



Classes [hide private]
  Version
Functions [hide private]
 
addLog(level, msg, stackTrace=None) source code
 
join(msg, *args) source code
 
debug(msg, *args)
Logs a debug message if debug messages are enabled.
source code
 
info(msg, *args)
Logs an info level message if info messages are enabled.
source code
 
warn(msg, *args)
Logs a warning message if warn messages are enabled.
source code
 
error(msg, *args)
Logs an error message if debug messages.
source code
 
fatal(msg, *args)
Logs a fatal message.
source code
boolean
isDebugEnabled()
Checks whether DEBUG messages are configured to be written to the log file.
source code
boolean
isInfoEnabled()
Checks whether INFO messages should be written to the log file, acording to The method checks in thel log4j properties file.
source code
 
prepareJythonStackTrace(msg, *args) source code
 
prepareJavaStackTrace() source code
string
prepareFullStackTrace(msg, *args)
Returns the full exception stack trace from both Java and Jython.
source code
 
debugException(msg, *args)
Writes the full exception stack trace from both Java and Jython to the log at the debug level.
source code
 
infoException(msg, *args)
Writes the full exception stack trace from both Java and Jython to the log at the info level.
source code
 
warnException(msg, *args)
Writes the full exception stack trace from both Java and Jython to the log at the warn level.
source code
 
errorException(msg, *args)
Writes the full exception stack trace from both Java and Jython to the log at the error level.
source code
 
fatalException(msg, *args)
Writes the full exception stack trace from both Java and Jython to the log at the fatal level.
source code
 
reportWarning(warning=None) source code
 
reportError(error=None) source code
 
reportWarningObject(warnobj) source code
 
reportErrorObject(errobj) source code
 
__reportWarning(errorCode, params, errmsg, framework) source code
 
__reportError(errorCode, params, errmsg, framework) source code
 
__getVersion(framework) source code
Variables [hide private]
  cat = Category.getInstance('PATTERNS_DEBUG')
Function Details [hide private]

debug(msg, *args)

source code 

Logs a debug message if debug messages are enabled.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

info(msg, *args)

source code 

Logs an info level message if info messages are enabled.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

warn(msg, *args)

source code 

Logs a warning message if warn messages are enabled.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

error(msg, *args)

source code 

Logs an error message if debug messages.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

fatal(msg, *args)

source code 

Logs a fatal message.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

isDebugEnabled()

source code 

Checks whether DEBUG messages are configured to be written to the log file. The method checks in thel log4j properties file.

Returns: boolean
true if the debug messages should be written, false otherwise

isInfoEnabled()

source code 

Checks whether INFO messages should be written to the log file, acording to The method checks in thel log4j properties file.

Returns: boolean
true if the info messages should be written, false otherwise

prepareFullStackTrace(msg, *args)

source code 

Returns the full exception stack trace from both Java and Jython.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log
Returns: string
full Stack Trace string (both java and jython)

debugException(msg, *args)

source code 

Writes the full exception stack trace from both Java and Jython to the log at the debug level.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

infoException(msg, *args)

source code 

Writes the full exception stack trace from both Java and Jython to the log at the info level.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

warnException(msg, *args)

source code 

Writes the full exception stack trace from both Java and Jython to the log at the warn level.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

errorException(msg, *args)

source code 

Writes the full exception stack trace from both Java and Jython to the log at the error level.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log

fatalException(msg, *args)

source code 

Writes the full exception stack trace from both Java and Jython to the log at the fatal level.

Parameters:
  • msg (string) - the log message
  • args - additional variables to log



Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.